package com.sayice.design.End8_5;

import java.util.ArrayList;
import java.util.List;

public class Building {
    private String color;
    Builder builder;
    List <Block>list=new ArrayList<>();
    public Building(Builder builder){
        this.builder=builder;
    }
    public void buildBlindage(){
        list.add(builder.addCube());
        list.add(builder.addCylinder());
        list.add(builder.addPyramid());
    }
    public void changeColor(String color){
        this.color=color;
        for(int i=0;i<list.size();i++)
            list.get(i).color=color;
    }
    public void displayColor(){
        for(int i=0;i<list.size();i++)
            System.out.println(list.get(i).getClass()+list.get(i).color);
    }
}
